/*
 * ShoppingCartShopHolder.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.view.View;
import android.widget.CheckBox;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.yidiandao.business.R;
import com.yidiandao.business.data.bean.Shop;
import com.yidiandao.business.ui.widget.listview.ViewHolder;

/** 购物车-商品所属店铺 Item ViewHolder */
public class ShoppingCartShopHolder extends ViewHolder {

    public RelativeLayout mRlytSelect;

    public CheckBox mCbSelect;
    public View root;
    private TextView mTvShopName;

    @Override
    protected void initView(View rootView) {
        mRlytSelect = (RelativeLayout) rootView.findViewById(R.id.rlyt_select);
        mCbSelect = (CheckBox) rootView.findViewById(R.id.cb_select);
        mTvShopName = (TextView) rootView.findViewById(R.id.tv_shop_name);
        root = rootView;
    }

    @Override
    protected int getItemLayoutId() {
        return R.layout.item_shopping_cart_shop;
    }

    public void refreshUI(Shop shop) {
        mTvShopName.setText(shop.getSupplierName());

        mCbSelect.setChecked(shop.isSelected());
    }
}
